package dk.dashboardFP.uiElements.scrollbar {
	import flash.display.Sprite;

	/**
	 * @author jk
	 */
	public class ScrollbarBackSimple extends Sprite implements IScrollBack {
		private var _uintColor : uint;
		private var _nAlpha : Number;
		private var _nRoundedCorners : Number;
		private var _nHeight : Number;
		private var _nWidth : Number;

		public function ScrollbarBackSimple(nColor : uint=0x000000, nAlpha : Number=0.15, nWidth:Number=10, nRoundedCorners : Number=3) {
			_nWidth = nWidth;
			_nRoundedCorners = nRoundedCorners;
			_nAlpha = nAlpha;
			_uintColor = nColor;
		}

		public function set nHeight(nHeight : Number) : void {
			_nHeight = nHeight;
			drawBar();
		}
		
		private function drawBar() : void {
			graphics.clear();
			graphics.beginFill(_uintColor, _nAlpha);
			graphics.drawRoundRect(0, -_nHeight / 2, _nWidth, _nHeight, _nRoundedCorners, _nRoundedCorners);
		}

		public function show() : void {
			visible=true;
		}
		
		public function hide() : void {
			visible=false;
		}
	}
}
